<template>
  <component :is="currentView"></component>
</template>

<script>
import Vue from 'vue'
import CompMain from './main.vue'
import CompTest from './test.vue'
var socket = io.connect('http://localhost:3000');
socket.on('news', function (data) {
  console.log(data);
  socket.emit('my other event', { my: 'data' });
});
export default {
  data () {
    return {
      currentView:'comp-main'
    }
  },
  components:{
    CompMain,
    CompTest
  },
  methods:{
    chgComp:function(compName){
      this.currentView = compName;
    }
  }

}
</script>
